Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, digital cameras, digital recording devices, digital media players, video gaming devices, video game consoles, cellular or satellite radio telephones, video teleconferencing devices, and the like. Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, Advanced Video Coding (AVC), or the emerging High Efficiency Video Coding (HEVC) standard, and extensions of such standards.
Video compression techniques perform spatial prediction and/or temporal prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video frame or slice may be partitioned into video blocks or coding units (CUs). CUs may be further partitioned into one or more prediction units (PUs) to determine predictive video data for the CU. The video compression techniques may also partition the CUs into one or more transform units (TUs) of residual video block data, which represents the difference between the video block to be coded and the predictive video data. Linear transforms, such as a two-dimensional discrete cosine transform (DCT), may be applied to a TU to transform the residual video block data from the pixel domain to the frequency domain to achieve further compression.
Following the transforms, transform coefficients within the TU may be further compressed via quantization. Following quantization, an entropy coding unit may apply a zig-zag scan or another scan order associated with a size of the TU to scan the two-dimensional array of coefficients in the TU to produce a serialized vector that can be entropy encoded. The entropy coding unit then entropy codes the serialized vector of coefficients. For example, the entropy coding unit may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), or another entropy coding technique. In the case of context adaptive entropy coding, the entropy coding unit may select contexts for each of the coefficients within the TU according to a context model associated with the size of the TU. The coefficients may then be entropy encoded based on the selected contexts.